# $Id: PKGBUILD 87104 2013-03-27 08:08:02Z mtorromeo $
# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>

pkgbase=python-oauthlib
pkgname=(python-oauthlib python2-oauthlib)
pkgver=0.4.0
pkgrel=1
_libname=oauthlib
pkgdesc="A generic, spec-compliant, thorough implementation of the OAuth request-signing logic"
arch=(any)
url="https://github.com/idan/oauthlib"
license=('BSD')
source=(http://pypi.python.org/packages/source/${_libname:0:1}/$_libname/$_libname-$pkgver.tar.gz)
makedepends=(python-distribute python2-distribute)

build() {
	cd "$srcdir/$_libname-$pkgver"
	
	rm -rf ../buildpy3; mkdir ../buildpy3
	python setup.py build -b ../buildpy3
	
	rm -rf ../buildpy2; mkdir ../buildpy2
	python2 setup.py build -b ../buildpy2
}

package_python-oauthlib() {
	depends=(python-crypto)
	
	cd "$srcdir/$_libname-$pkgver"
	rm -rf build; ln -s ../buildpy3 build
	python setup.py install --skip-build -O1 --root="$pkgdir"
	install -m0644 -D "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_python2-oauthlib() {
	depends=(python2-crypto)
	
	cd "$srcdir/$_libname-$pkgver"
	rm -rf build; ln -s ../buildpy2 build
	python2 setup.py install --skip-build -O1 --root="$pkgdir"
	install -m0644 -D "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

sha256sums=('9fa2f6ecc03529b12e9c9445e9a29ca72fecdebfe1f7f5ccc9242ba7a9c4e996')
